<?php
// +----------------------------------------------------------------------
// | 会员管理首页
// +----------------------------------------------------------------------
// | Copyright (c) 2015
// +----------------------------------------------------------------------
// | Author: baiping 125618036@qq.com http://www.webipcode.com
// +----------------------------------------------------------------------
// | 2015-6-26上午11:13:48
// +----------------------------------------------------------------------
?>
<?php $this->load->view('public/header');?>
<?php $this->load->view('public/head');?>
<div class="container-fluid">
	<div class="row">
		<?php $this->load->view('public/sideleft');?>
		<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main ">
			<!-- 内容区 -->
			<div class="main-title">
				<h3>
					<?php echo $meta_title ?>
				</h3>
			</div>
			<div class="con">
				<div class="cf">
					<div class="pull-left">
						<a href="<?php echo site_url('authmanager/create')?>" class="btn btn-primary">新增</a> 
						<a href="<?php echo site_url('authmanager/changesstatus/disable/?status_val=1')?>" class="btn btn-success ajax-post confirm" target-form="ids">启用</a> 
						<a href="<?php echo site_url('authmanager/changesstatus/disable/?status_val=2')?>" class="btn btn-warning ajax-post confirm" target-form="ids">禁用</a> 
						<a href="<?php echo site_url('authmanager/changesstatus/delete')?>" class="btn btn-danger ajax-post confirm" target-form="ids">删除</a>
					</div>
				</div>
				<div class="clearfix"></div>
				<!-- 内容列表 -->
				<?php if ( $record_count > 0 ){?>
				<table class="table table-striped table-hover ">
					<thead>
						<tr>
							<th class="row-selected"><input class="checkbox check-all" type="checkbox"></th>
							<th>角色</th>
							<th>描述</th>
							<th>授权</th>
							<th>状态</th>
							<th>操作</th>
						</tr>
					</thead>
					<?php foreach($list as $key => $val){?>
					<tr>
						<td>
							<input class="ids row-selected" type="checkbox" value="<?php echo $val->id; ?>" name="id[]">
						</td>
						<td><small><a href="<?php echo site_url('authmanager/modfiy/'.$val->id);?>"><?php echo $val->title;?></a></small></td>
						<td><small><?php echo $val->description;?></small></td>
						<td>
							<a href="<?php echo site_url('authmanager/access/'.$val->id)?>">访问授权</a>
							<a href="<?php echo site_url('authmanager/user/'.$val->id)?>">成员授权</a>
						</td>
						<td>
							<?php if($val->status == 1){?>
							<span class="label label-success">正常</span>
							<?php }elseif($val->status == 0){?>
							<span class="label label-info">禁用</span>
							<?php }elseif ( $val->status == -1 ){?>
							<span class="label label-danger">删除</span>
							<?php }?></td>
						<td>
							<?php if ( $val->status == 1 ){?>
							<a href="<?php echo site_url('authmanager/changesstatus/disable/'.$val->id.'/?status_val=2')?>" class="confirm ajax-get">禁用</a>
							<a href="<?php echo site_url('authmanager/changesstatus/delete/'.$val->id)?>" class="confirm ajax-get">删除</a>
							<?php }elseif ($val->status <= 0){?>
							<a href="<?php echo site_url('authmanager/changesstatus/disable/'.$val->id.'/?status_val=1')?>" class="confirm ajax-get">启用</a>
							<?php }?>
							
						</td>
					</tr>
					<?php }?>
				</table>
				<?php }else{?>
				<div class="alert alert-warning" role="alert">哦亲！暂无数据</div>
				<?php }?>	
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
//左侧菜单高亮显示
highlight_subnav( '<?php echo site_url('menu/index')?>' );
</script>
<?php $this->load->view('public/footer');?>